<template>
<div id="content">
  <h2>{{obj.title}}</h2>
  <div v-html="obj.content"/>
</div>
</template>
<script>
export default {
  name: "Content",
  data(){
    return{
        obj:{}
    }
  },methods:{
    requestData(aid){
      let api='http://www.phonegap100.com/appapi.php?a=getPortalArticle&aid='+aid;
      this.$http.jsonp(api).then(res=>{
        this.dyt2(res,"详情页面开始",'详情页面结束')
        this.obj=(res.body.result)[0];
      },err=>{
        this.dyn(err)
      })
    }
  },mounted() {
    let aid=this.$route.query.canShu001;
    this.requestData(aid);
  }
}
</script>
<!-- 这里不能用scoped 因为父里面有 子里有的话无法设置样式 -->
<style lang="scss">
  #content{
    padding: 1rem;
    line-height: 2;
    img{
      max-width: 70%;
    }
  }
</style>
